import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './components/app.vue';
import test from './components/ExampleComponent.vue'
import test2 from './components/ExampleComponent2.vue'

import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';

Vue.use(VueRouter);
Vue.use(ViewUI);

// 路由配置
const RouterConfig = {
        routes: [
            // ExampleComponent laravel默认的示例组件
            {
                path: "/home", component: App,
                children: [
                    {path: '/test', component: resolve => require(['./components/ExampleComponent.vue'], resolve)},
                    {path: '/test2/:id', component: test2}
                ]
            }
        ]
    };
const router = new VueRouter(RouterConfig);

const app = new Vue({
    el: '#app',
    router: router,
    //render: h => h(App)
});
